package team.group.exam.biz.impl;

import java.util.List;

import team.group.exam.biz.IUsersBiz;
import team.group.exam.dao.IUsersDao;
import team.group.exam.entity.TbPaper;
import team.group.exam.entity.TbUser;

public class UsersBizImpl implements IUsersBiz{

	private IUsersDao userDao;
	
	/**
	 * 增加一个用户信息
	 */
	@Override
	public void addUser(TbUser user) {
		userDao.addUser(user);
	}

	/**
	 * 删除一个用户信息
	 */
	@Override
	public void deleteUser(TbUser user) {
		userDao.deleteUser(user);
		
	}
	/**
	 * 更新一个用户信息
	 */
	@Override
	public void updateUser(TbUser user) {
		userDao.updateUser(user);
		
	}

	/**
	 * 得到所有的用户
	 */
	@Override
	public List<TbUser> getAllUsers() {
		List<TbUser> list = userDao.getAllUsers();
		return list;
	}

	/**
	 * 分页查询所有的用户
	 */
	@Override
	public List<TbUser> getAllUsers(int currentPage) {
		List<TbUser> list = userDao.getAllUsers(currentPage);
		return list;
	}
	
	@Override
	public TbUser getUserById(int id) {
		TbUser user = userDao.getUserById(id);
		return user;
	}

	@Override
	public boolean userLogin(TbUser user) {
		Boolean bo = userDao.userLogin(user);
		return bo;
	}

	/**
	 * getter() 和   setter()方法
	 * @return
	 */
	public IUsersDao getUserDao() {
		return userDao;
	}

	public void setUserDao(IUsersDao userDao) {
		this.userDao = userDao;
	}

	/**
	 * 查询总页数
	 */
	@Override
	public int getTotalPage() {
		// TODO Auto-generated method stub
		return userDao.getTotalPage();
	}

	@Override
	public void addUserToPaper(TbPaper paper) {
		// TODO Auto-generated method stub
		userDao.addUserToPaper(paper);
	}

	@Override
	public List<TbPaper> getUserPaper(TbUser user) {
		// TODO Auto-generated method stub
		List<TbPaper> list = userDao.getUserPaper(user);
		return list;
	}

	@Override
	public TbUser getcheckUser(TbUser user) {
		// TODO Auto-generated method stub
		return userDao.getcheckUser(user);
	}

	
	
}
